﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebSite_CodeMan.Sys_CodeMan_Manage
{
    public partial class Admin_DataManage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Common.MessageBox.myScriptMes(Page, "CloseDiv()", "Load");
            BaseClass.BaseClass.CheckState();
        }

        protected void BtnBak_Click(object sender, EventArgs e)
        {
            try
            {
                var dbfile = Common.GetMes.GetConfigAppValue("DbFile");
                DBUnlity.AccessHelper.CloseAllConn();
                Common.FileComm.CopyFile(Server.MapPath("~/App_Data/" + dbfile), Server.MapPath("~/DataBak/"), DateTime.Now.ToString("yyyyMMddHHmmss") + ".config");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        protected void BtnClear_Click(object sender, EventArgs e)
        {
            Common.FileComm.DelAllFile(Server.MapPath("~/DataBak/"));
        }
    }
}
